package com.ojoin.trade.supplyloan_core.web.service;

import java.util.List;

import org.springframework.data.domain.Pageable;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.web.service.BaseService;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlPlatformUser;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlStatetaskRunresultvo;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlStattaskRunresult;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 15-10-27
 * Time: 下午4:40
 * To change this template use File | Settings | File Templates.
 */
public interface TbSlStattaskRunresultService extends BaseService<TbSlStattaskRunresult> {
    /**
     * 新增供应商日定时任务运行的总体情况信息
     * @param taskresultvo
     * @throws BusinessException
     */
    public void insertTbSlStattaskRunresult(TbSlStattaskRunresult taskresultvo)throws BusinessException;

    /**
     *查询join用户当日的运行情况
     * @param joinid
     * @return
     * @throws BusinessException
     */
    public List<TbSlStattaskRunresult> queryTodayTbSltaskRunresultByJoinid(int joinid)throws BusinessException;

    /**
     *查询所有商户的当日的运行情况表
     * @return
     * @throws BusinessException
     */
    public List<TbSlStatetaskRunresultvo> queryAllTbSltaskRunresultToday(Pageable page)throws BusinessException;
    
    /**
     *查询所有商户的当日的运行情况表
     * @return
     * @throws BusinessException
     */
    public List<TbSlStatetaskRunresultvo> queryAllTbSltaskRunresultToday()throws BusinessException;
    
    
    /**
     * 查询统计数据
     *
     * @param platformUserId 商户id
     * @param statDate   平台
     * * @param statDate  时间 
     * @throws BusinessException 
     */
    public List<TbSlStatetaskRunresultvo> queryByPlatformAndMerchantUserIDAndDate(String platformName,String  merchantUserId,String statDate,Pageable page) throws BusinessException;
    
    /**
     *查询当日失败运行情况信息 
     * @return
     * @throws BusinessException
     */
 
    public List<TbSlStatetaskRunresultvo> queryAllFailureTbSltaskRunresultToday()throws BusinessException;

    /**
     * 查询当日成功运行情况信息
     * @return
     * @throws BusinessException
     */
    public List<TbSlStatetaskRunresultvo> queryAllSuccessTbSltaskRunresultToday()throws BusinessException;
    
    public void deleteByPlateFormAndTime(int plateformId,String time)throws BusinessException;
     
    public TbSlStattaskRunresult getByPlatformUser(TbSlPlatformUser platformUser);

    /**
     * 根据商户和日期查询商户失败的运行任务
     * @param joinid
     * @param curdate
     * @return
     * @throws BusinessException
     */
    
    public void updateByIdOfPlatformUserAndtaskExecDate(TbSlStattaskRunresult stattaskRunresult) throws BusinessException;
    
    public void deleteAndAdd(TbSlStattaskRunresult stattaskRunresult) throws BusinessException;
    
    public List<TbSlStattaskRunresult> queryFailureByJoinid(int joinid)throws BusinessException;
    
    boolean isCatchSucceed(TbSlStatetaskRunresultvo tb);
    
    boolean isCatchSucceed(TbSlStattaskRunresult tb);

    
}
